#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
	int num;
	int denum;
} fract;

int ticket_lucky(int x, int lenx) {
	int sum = 0, len = 0;

	if ( lenx % 2 != 0 )
		return 0;

	while ( 0 < x ) {
		len++;
		if (len <= lenx/2){
			sum += x % 10;
		}else{
			sum -= x % 10;
		}
		x /= 10;
	}

	return !sum;
}

void fract_calcel(fract *f) {
	int big;
	int small;
	int i;
	int found = 1;

	if ( f->num < f->denum ) {
		small = f->num;
		big = f->denum;
	}
	else {
		big = f->num;
		small = f->denum;
	}

	while ( found ) {
		found = 0;
		for ( i = 2; i <= small; i++ ) {
			if ( f->num % i == 0 && f->denum % i == 0 ) {
				f->num /= i;
				f->denum /= i;
				found = 1;
				break;
			}
		}
	}
}

int loop(int a, int b, int k, int len_a) {
	int i, j;
	int j_lucky;
	int median;
	fract f; // cancelled out fraction (answer)

	j_lucky = 0;

	for ( i = a; i <= b; i++ ) {
		for ( j = i; j < i+k; j++ ) {
			if ( ticket_lucky(j, len_a) ) {
				j_lucky++;
			}
		}
	}

	median = b - a + 1;

	f.num = j_lucky;
	f.denum = median;
	fract_calcel(&f);

	if ( f.num % f.denum == 0 )
		printf("%d\n", f.num / f.denum);
	else
		printf("%d/%d\n", f.num, f.denum);

	return 0;
}

int main(int argc, char *argv[])
{
	int a;
	int b;
	int k;
	int len_a;

	if ( argc != 4 ) {
		fprintf(stderr, "Give a b k as args\n");
		return 1;
	}

	len_a = strlen(argv[1]);

	a = atoi(argv[1]);
	b = atoi(argv[2]);
	k = atoi(argv[3]);

	loop(a, b, k, len_a);

	return 0;
}
